import React from 'react';
import { Progress as AntdProgress } from 'antd';
import type { ProgressProps as AntdProgressProps } from 'antd';
import { createStyles } from 'antd-style';

export interface ProgressProps extends AntdProgressProps {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  progress: css`
    .ant-progress-text {
      color: ${token.colorText};
    }
  `,
}));

const Progress: React.FC<ProgressProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const progressClassName = cx(
    className,
    customClassName,
    styles.progress
  );

  return <AntdProgress className={progressClassName} {...restProps} />;
};

export { Progress };
export default Progress;

